<template>
	<view>
		<view class="list">
			<view class="list-item" v-for="it in list">
				<view class="list_item" @click="toMixinIndex(1,{userId: it.user_id})">
					<image class="list_item-img" :src="it.head" style="border-radius: 50%;"></image>
					<view class="list_item-content">
						<view class="list_item-content-h">
							<view class="list_item-content-h-name">
								{{it.nickname}}
								<image :src="ossUrl + `/static/card/6.png`" mode=""></image>
							</view>
							<view class="list_item-content-h-address" v-if="it.address">
								<image :src="ossUrl + `/static/card/2.png`" mode=""></image>
								{{it.address || ''}}
							</view>
						</view>
						<view class="list_item-content-subTitle">
							{{it.name || ''}}
							
						</view>

						<view class="list_item-content-address">{{it.company || ''}}</view>
						 <view class="list_item-content-address" style="color: #12B475;">分享数：{{it.count || 0}}人</view>
					</view>
					<view class="list_item-rig">
						<view class="list_item-rig-time">{{it.create_time || ''}}</view>
						<view class="list_item-rig-price">消费：{{it.consumption}}元</view>
						
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		InformationLianchuangList,
		InformationLianchuangData
	} from '@/common/http/api.js'
	export default {
		props:['list'],
		data() {
			return {
				//分页
				params:{
					page: 1,
					nickname: ''
				},
				isList: true, 
				list: [],
				info: ''
			};
		},
		
		onReachBottom() {
			if(this.isList){
				this.params.page ++
				this.init()
			}
		},
		methods:{
			reload(){
				this.list = []
				this.params.page = 1
				this.init()
			},
			init(){
				uni.showLoading()
				InformationLianchuangList(this.params).then(res=>{
					uni.hideLoading()
					if(Array.isArray(res.data) && res.data.length > 0) {
						if(this.params.page === 1) {
							this.list = res.data
						} else {
							this.list = this.list.concat(res.data)
						}
					} else {
						this.isList = false
					}
				})
			},
			
			toPage(it){
				uni.redirectTo({
					url:'/pagesA/posterDesign/add?id=' + it.id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	image {
		width: 100%;
		height: 100%;
	}
	.search {
			width: 100%;
			display: flex;
			align-items: center;
			box-sizing: border-box;
			padding: 0 25rpx;
			margin-bottom: 30rpx;
			.search-tx {
				flex: 1;
				font-family: PingFang SC;
				font-weight: 500;
				font-size: 32rpx;
				color: #211C1E;
			}
			.search-input {
				width: 481rpx;
				height: 70rpx;
				background: #FFFFFF;
				border-radius: 35rpx;
				display: flex;
				align-items: center;
				box-sizing: border-box;
				padding: 15rpx 24rpx;
				image {
					width: 40rpx;
					height: 40rpx;
					margin-right: 17rpx;
				}
				input {
					flex: 1;
					min-width: 0;
					input {
						font-family: PingFang SC;
						font-weight: 400;
						font-size: 26rpx;
						color: #999999;
					}
					.search-input-ac {
						font-family: PingFang SC;
						font-weight: 400;
						font-size: 26rpx;
						color: #999999;
					}
				}
			}
		}
		.list {
				width: 100%;
		
				.list-item {
					width: 100%;
					margin-bottom: 10rpx;
					border-bottom: 10rpx solid #eee;
					background: white;
					.list_item {
						box-sizing: $uni-bg-color;
						padding: 39rpx 49rpx;
						display: flex;
						align-items: center;
		
						.list_item-img {
							width: 100rpx;
							height: 100rpx;
							margin-right: 13rpx;
						}
		
						.list_item-content {
							width: 350rpx;
		
							.list_item-content-h {
								display: flex;
								align-items: center;
								justify-content: space-between;
								margin-bottom: 16rpx;
		
								.list_item-content-h-name {
									display: flex;
									align-items: center;
									font-family: PingFang SC;
									font-weight: 400;
									font-size: 30rpx;
		
									image {
										margin-left: 14rpx;
										width: 26rpx;
										height: 26rpx;
									}
								}
		
								.list_item-content-h-address {
									display: flex;
									align-items: center;
									font-family: PingFang SC;
									font-weight: 300;
									font-size: 24rpx;
									color: #7A7A7A;
									
									image {
										margin-right: 10rpx;
										width: 30rpx;
										height: 30rpx;
									}
								}
							}
		
							.list_item-content-subTitle {
								font-family: PingFang SC;
								font-weight: 400;
								font-size: 24rpx;
								color: #666666;
								display: flex;
								align-items: center;
								margin-bottom: 10rpx;
		
								text {
									font-family: PingFang SC;
									font-weight: 400;
									font-size: 22rpx;
									color: #12B475;
									margin-left: 36rpx;
								}
							}
		
							.list_item-content-address {
								min-width: 0;
								font-family: PingFang SC;
								font-weight: 400;
								font-size: 24rpx;
								color: #666666;
								overflow: hidden;
								white-space: nowrap;
								text-overflow: ellipsis;
								//height: 23rpx;
							}
						}
		
						.list_item-rig {
							flex: 1;
							min-width: 0;
							display: flex;
							flex-direction: column;
							justify-content: space-between;
							align-items: flex-end;
							height: 100rpx;
							.list_item-rig-time {
								font-family: PingFang SC;
								font-weight: 300;
								font-size: 22rpx;
								color: #7A7A7A;
							}
							.list_item-rig-price {
								font-family: PingFang SC;
								font-weight: 400;
								font-size: 24rpx;
								color: #12B475;
							}
						}
					}
				}
			}
			
	.list_item-content-h-address {
		width: 170rpx;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
		display: block!important;
		image {
			margin-bottom: -5rpx;
		}
	}
</style>